<%@ page language="java" import="java.util.*"%>
<%@ page session="true"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="t"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>  
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 

 <%
             Cookie cookie = null;
                      Cookie[] cookies = null; 
                        // Get an array of Cookies associated with this domain
                      cookies = request.getCookies();
   
                      if( cookies != null ){ 
                        for (int i = 0; i < cookies.length; i++){
          
                         cookie = cookies[i];
                            
                          if(cookie.getName().equals("billing") && !cookie.getValue().equals("")){
                                 cookie.setValue("");
                                 cookie.setMaxAge(0);
                                 response.addCookie(cookie); 
                           } 
                        }
                     }    
                      
                             HttpSession newSesion  ;  
        newSesion = request.getSession(false);
        
        newSesion.setAttribute("sessionId", ""); 
                      
                        session.invalidate(); 
                      String ipCustom = request.getRemoteAddr();
        
    %>


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${system.userName.trim()}</title>
 <%@include file="../../template/estilos_login.jsp"%>
 <%@include file="../../template/script_login.jsp"%>
 <script src="${pageContext.request.contextPath}/resources/assets/scripts/module/login.js" type="text/javascript" ></script>
	
 <link href="${pageContext.request.contextPath}/resources/assets/css/pages/lock.css" rel="stylesheet" type="text/css"/>
   <script src="${pageContext.request.contextPath}/resources/assets/scripts/lock.js" type="text/javascript"></script>      
	
    </head>
  
    <body>
        <div class="page-lock">
		<div class="page-logo">
			<a class="brand" href="index.html">
			<img src="/GedeonMvc/resources/assets/img/logo-big.png" alt="logo" />
			</a>
		</div>
            
            <form action="/GedeonMvc/login/login" class="form-vertical login-form" commandName="systemUser" id="form"  method="post">
            <c:forEach var="system" items="${dataSystem}">
            <input type="hidden" value="${pageContext.session.id}" name="sessionId" id="sessionId" />
             <input type="hidden" name="ipComputer" id="ipComputer" value="<%= ipCustom %>" />
               <input type="hidden"  name="userName" id="userName" value="${system.userName.trim()}"  /> 
               <input type="hidden" name="pagereturn" id="pagereturn" value="/login/lockscreen" />
		<div class="page-body">
			<img class="page-lock-img" src="${pageContext.request.contextPath}/resources/userPictures/${system.imageName.trim()}" alt="">
			<div class="page-lock-info">
				<h1>${system.name.trim()}&nbsp;${system.lastName.trim()}</h1>
				<span>${system.email.trim()}</span>
				<span><em><font color="#585858"><b>Locked</b></font></em></span>
				  
                                <div class='alert alert-error' id="wrongPassword" style="display: none;height:10px;">
                                    
                                    <span><font color="#585858"><b>Contraseña inv&aacute;lida.</b></font><i class='icon-remove' onclick="ocultarDiv();"></i></span>
                                </div>
                                
					<div class="input-append">
						<input type="password" class="m-wrap" placeholder="Password" name="password" id="password">
						<button type="button" onclick="loginValidateByAjax();" class="btn blue icn-only"><i class="m-icon-swapright m-icon-white"></i></button>
                                          
                                        </div>
                                 
					<div class="relogin">
						<a href="logout">Not ${system.name.trim()}&nbsp;${system.lastName.trim()} ?</a>
					</div>
			 
			</div>
		</div>
                </c:forEach> 
            </form>
		<div class="page-footer">
			2013 &copy; Metronic. Admin Dashboard Template.
		</div>
	</div>
	
    </body>
    <script>
		jQuery(document).ready(function() {    
		   App.init();
		   Lock.init();
		});
	</script>
</html>
